<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>edit page</title>
</head>
<body>
<h1>edit page</h1>
<form action="product/modify" method="post" enctype="multipart/form-data">
  <input type="hidden" name="id" value="${sessionScope.product.id}">
  <input type="text" name="title" placeholder="TITLE" required value="${sessionScope.product.title}">
  <br>
  <select name="type">
    <option value="自营">自营</option>
    <c:if test="${sessionScope.product.type eq '第三方'}">
      <option value="第三方" selected="selected">第三方</option>
    </c:if>
    <c:if test="${sessionScope.product.type ne '第三方'}">
      <option value="第三方">第三方</option>
    </c:if>
  </select>
  <br>
  <textarea name="description" cols="35" rows="5" placeholder="描述信息">${sessionScope.product.description}</textarea>
  <br>
  <input type="number" min="0.00" max="99999.99" step="0.01" name="originalPrice" placeholder="折扣价" value="${sessionScope.product.originalPrice}">
  <br>
  <input type="number" min="0.00" max="99999.99" step="0.01" name="currentPrice" placeholder="原价" value="${sessionScope.product.currentPrice}">
  <img src="/picture/${sessionScope.product.currentPrice}" height="100">
  <input type="file" name="file" value="${sessionScope.product.picture}">
  <br>
  <input type="submit" value="save">
</form>
</body>
</html>
